#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>
int NumberOf1(int n) {
	int count = 0, i = 1, q;
	while (i > 0)
	{
		q = n & i;
		if (q != 0)
			count++;
		i <<= 1;
	}
	if (n >= 0)
		return count;
	else return count + 1;
}
int main()
{
	int a = 15;
	printf("%d", NumberOf1(a));
	return 0;
}